home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 008 / egaprob.arc / OUTFIX.ASM < prev    next >
Encoding:
Assembly Source File  |  1987-03-24  |  1.3 KB  |  41 lines

  1.  
  2. ;program outfix.asm
  3. ;replaces int 3 (breakpoint instruction) with 'out dx,ax' handler
  4.  
  5. cseg   segment
  6.        assume cs:cseg
  7.        org   100h
  8.  
  9. start  proc    near
  10.        jmp     makeres  ;make handler resident
  11.  
  12. int_3:                ;this routine gets called when int 3 generated
  13.        cli            ;disable interrupts
  14.        out   dx,al    ;out the low byte to (dx)
  15.        xchg  al,ah                                           
  16.        inc   dx
  17.        out   dx,al      ;out the high byte to (dx+1)
  18.        xchg  al,ah      ;put the registers back in order
  19.        dec   dx
  20.        sti              ;enable interrupts
  21.        iret             ;return to caller
  22. end_int_3:
  23.  
  24. makeres:
  25.     push    cs         ; get cs into ds
  26.     pop     ds
  27.     assume  ds:cseg  
  28.     mov     ax,2503h   ;ah=25  -> DOS set vector function, al=3 ->int 3 vecter
  29.     mov     dx,offset int_3    ;dx=vector to be loaded into vector table 
  30.     int     21h                ;call DOS service     
  31.     mov     dx,offset end_int_3 ;get size of handler in bytes
  32.     mov     cl,4
  33.     shr     dx,cl
  34.     inc     dx                  ;convert to paragraphs
  35.     mov     ax,3100h            ;ah= ->DOS keep process function
  36.     int     21h                 ;call DOS service
  37.  
  38. start   endp
  39. cseg    ends
  40.         end  start  
  41.